package 牛客;

public class 调整数组顺序使奇数位于偶数前面 {
    public int[] reOrderArray (int[] array) {
        // write code here
        for(int i=0;i<array.length;i++){
            for(int j=0;j<array.length-1-i;j++){
                if(array[j]%2!=0&&array[j+1]%2==0){
                    int t=array[j];
                    array[j]=array[j+1];
                    array[j+1]=t;
                }
            }
        }
        return array;
    }
}
